#ifndef __COMPONENT_CREATURE_H__
#define __COMPONENT_CREATURE_H__

#include "Component.hpp"
#include "GameEnum.h"
#include <string>

namespace PocketSurvival
{
    struct ComponentBody;
    struct ComponentHealth;
    struct ComponentLocomotion;
    struct ComponentCreatureModel;
    struct ComponentSpawn;
    struct ComponentCreatureSounds;

    struct ComponentCreature : public Component
    {
        // 是否一直保留不清理掉
        bool constantSpawn;
        // 生物类别
        CreatureCategory category;
        // 生物名称
        std::string displayName;

        ComponentBody *componentBody;
        ComponentHealth *componentHealth;
        ComponentLocomotion *componentLocomotion;
        ComponentCreatureModel *componentCreatureModel;
        ComponentSpawn *componentSpawn;
        ComponentCreatureSounds *componentCreatureSounds;

        virtual const std::string &getName() const override;
        static const std::string &GetName();
        virtual void load(const nlohmann::json &jsonData) override;
        virtual void save(nlohmann::json &jsonData) override;
        virtual void saveToMsgJson(nlohmann::json &jsonData) override;
    };

} // namespace PocketSurvival

#endif